﻿package com.example.mobiledestroy.view;


import com.example.mobiledestroy.BindActivity;
import com.example.mobiledestroy.R;
import com.example.mobiledestroy.util.MD5;
import com.example.mobiledestroy.util.SMSService;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TitleBarLayout extends LinearLayout {

    private TextView titleTextView;
	private Button titleButton;

	public TitleBarLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        
        LayoutInflater.from(context).inflate(R.layout.layout_title_bar, this);
		titleTextView = (TextView)this.findViewById(R.id.title_text);
		titleButton = (Button)this.findViewById(R.id.title_right);
		
    }
	
	public void setButtonVisible(){
		titleButton.setVisibility(View.VISIBLE);
	}
	
	public void setText(String title){
		titleTextView.setText(title);
	}

	public void setButtonClicker(View.OnClickListener left) {
		titleButton.setOnClickListener(left);
	}
}
